package com.project.webpage.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.project.webpage.dto.ForecastTotalDto;
import com.project.webpage.dto.SearchByMonthParam;
import com.project.webpage.dto.SearchByRqParam;
import com.project.webpage.dto.SearchByRqRangeParam;
import com.project.webpage.mapper.ForecastTotalMapper;
import com.project.webpage.service.ForecastTotalService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ForecastTotalServiceImpl implements ForecastTotalService {

    @Resource
    private ForecastTotalMapper forecastTotalMapper;

    @Override
    @DS("secondary")
    public List<ForecastTotalDto> getListForPage(SearchByRqParam param) {
        return forecastTotalMapper.selectListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<ForecastTotalDto> getMonthlyListForPage(SearchByMonthParam param) {
        return forecastTotalMapper.selectMonthlyListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<ForecastTotalDto> getCompanyDailyListForPage(SearchByRqParam param) {
        return forecastTotalMapper.selectCompanyDailyListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<ForecastTotalDto> getCompanyMonthlyListForPage(SearchByMonthParam param) {
        return forecastTotalMapper.selectCompanyMonthlyListByUid(param);
    }
}
